+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
+Mon Sep 21 07:44:30 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate
+ the required memory block, rather than allocating it newly from
+ scratch and doing a full-blown block copy on it.
+
Mon Sep 21 02:30:06 1998 Tim Janik <timj@gtk.org>
* NEWS file update for upcoming release of Gtk+ version 1.1.2,
static void
gtk_object_base_class_init (GtkObjectClass *class)
{
- /* reset instance specific fields that don't get inhrited */
+ /* reset instance specific fields that don't get inherited */
class->signals = NULL;
class->nsignals = 0;
class->n_args = 0;
guint *signals,
guint nsignals)
{
- guint *new_signals;
- guint i;
-
- g_return_if_fail (class != NULL);
-
- new_signals = g_new (guint, class->nsignals + nsignals);
- for (i = 0; i < class->nsignals; i++)
- new_signals[i] = class->signals[i];
- for (i = 0; i < nsignals; i++)
- new_signals[class->nsignals + i] = signals[i];
-
- g_free (class->signals);
- class->signals = new_signals;
+ g_return_if_fail (GTK_IS_OBJECT_CLASS (class));
+ if (!nsignals)
+ return;
+ g_return_if_fail (signals != NULL);
+
+ class->signals = g_renew (guint, class->signals, class->nsignals + nsignals);
+ memcpy (class->signals + class->nsignals, signals, nsignals * sizeof (guint));
class->nsignals += nsignals;
}